package mapred.util;

public class WeightMap extends Configuration<String, Double> {

	public WeightMap(String delim) {
		this(null, delim);
	}
	
	public WeightMap(String s, String delim) {
		super(s, delim, "\t");
	}

	@Override
	protected String decodeKey(String strKey) {
		return strKey;
	}

	@Override
	protected Double decodeValue(String strValue) {
		return Double.valueOf(strValue);
	}

	@Override
	protected boolean isValidKey(String key) {
		return (!key.isEmpty());
	}

	@Override
	protected Double mergeValue(String key, Double prev, Double cur) {
		return prev + cur;
	}

}
